/**
 * 
 */
package com.fita.admin.web.controller.client;

import com.demo2do.core.entity.page.Page;
import com.demo2do.core.entity.result.HttpResult;
import com.demo2do.core.web.interceptor.MenuSetting;
import com.demo2do.core.web.utils.WebUtils;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

/**
 * 客户访谈记录
 * 
 * @author Guangli Yan
 *
 */
@Controller
@RequestMapping(path = "/client-interviews")
@MenuSetting("menu-client")
public class ClientInterviewContorller {

    /**
     * @param request 
     * @return
     */
    @GetMapping(path = "")
    @MenuSetting("submenu-client-interview-management")
    public ModelAndView list(HttpServletRequest request, Page page) {

        ModelAndView modelAndView = new ModelAndView("client/client-interview/client-interview-list");

        modelAndView.addObject("queryString", WebUtils.extractQueryString(request, "filter", "page"));
        
        return modelAndView;
    }

    /**
     * @param clientId
     * @return
     */
    @GetMapping(path = "/{clientInterviewId}")
    @MenuSetting("submenu-client-interview-management")
    public ModelAndView view(@PathVariable Long clientInterviewId) {

        ModelAndView modelAndView = new ModelAndView("client/client-interview/client-interview-view");

        return modelAndView;
    }

    /**
     * @return
     */
    @GetMapping(path = "/add")
    public ModelAndView add() {

        ModelAndView modelAndView = new ModelAndView("client/client-interview/client-interview-add");

        return modelAndView;
    }

    /**
     * @return
     */
    @PostMapping(path = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public HttpResult onAdd() {

        HttpResult result = new HttpResult();

        return result;
    }

    /**
     * @return
     */
    @GetMapping(path = "/edit")
    public ModelAndView edit() {

        ModelAndView modelAndView = new ModelAndView("client/client-interview/client-interview-edit");

        return modelAndView;
    }

    /**
     * @return
     */
    @PatchMapping(path = "/{clientInterviewId}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public HttpResult onEdit(Long clientInterviewId) {

        HttpResult result = new HttpResult();

        return result;
    }

    /**
     * @return
     */
    @GetMapping(path = "/export")
    public ModelAndView export() {

        ModelAndView modelAndView = new ModelAndView("client/client-interview/client-interview-export");

        return modelAndView;
    }

    /**
     * @return
     */
/*    @PostMapping(path = "/export")
    public ModelAndView onExport() {

        ModelAndView modelAndView = new ModelAndView(new ExcelTemplateView(""));

        return modelAndView;
    }*/
    
    /**
     * @return
     */
    @GetMapping(path = "/{clientInterview}/delete")
    public ModelAndView delete(@PathVariable Long clientInterview) {

        ModelAndView modelAndView = new ModelAndView("client/client-interview/client-interview-delete");

        return modelAndView;
    }

    /**
     * @return
     */
/*    @PostMapping(path = "/{clientInterview}/delete")
    public ModelAndView onDelete() {

        ModelAndView modelAndView = new ModelAndView(new ExcelTemplateView(""));

        return modelAndView;
    }*/
    

}
